﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="/js/sortable.4.0.js"></script>
    <script type="text/javascript" src="/js/TableExt.js"></script>
    <script type="text/javascript" src="/js/api-parser.js"></script>
	<script type="text/javascript">
	    function TRRender(i, item, num) {
	        var html = '';
	        html += '<tr>';
	        for (var key in item) {
	            html += '<td>' + item[key] + '</td>';
	        }
	        return html;
	    }

	    function GetParams() {
	        return {};
	    }

	    var Table1 = null;
	    $(document).ready(function () {
	        Table1 = $('#tableList').NewTable('/douban/Collection?from=1&count=10', TRRender, GetParams);
//	        Table1 = $('#tableList').NewTable('/douban/sql', TRRender, GetParams);

	        Table1.OnJsonLoaded = function (json) {
	            var thead = $('#tableList thead').empty();
	            var fields = json.entry[0];
	            var html = '';
	            html += '<tr>';
	            for (var key in fields) {

	                html += '<th>' + key + '</th>';
	            }
	            html += '</tr>';
	            thead.html(html);
	        };

	        Table1.GetListData = function (json) {
	            Temp = json;
	            return json.entry;
	        }

	        Table1.LoadData();

	        $('#form1').bind('submit', function () {
	            Table1.LoadData();
	            return false;
	        });
	    });
	    var Temp = null;
    </script>
</head>
<body>
<div class="mainbox">
    <div class="rightbox">
    <input type="submit" id="btn_submit" class="input_send1" value="Submit">
    </div>
    <table id="tableList">
        <thead>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
</body>
</html>